package event;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class ActionEventEx3 {
	JButton btn1 = new JButton("North");
	JButton btn2 = new JButton("East");
	JButton btn3 = new JButton("Center");
	JButton btn4 = new JButton("South");
	JButton btn5 = new JButton("West");

	public ActionEventEx3(){
		JFrame f = new JFrame("Event Text_2");
		f.setBounds(450, 150, 300, 300);		

		f.add(btn1,"North");
		f.add(btn2,"East");
		f.add(btn3,"Center");
		f.add(btn4,"South");
		f.add(btn5,"West");

		btn1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent ae){			
				System.out.println("North Button");
			}
		});

		btn2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				System.out.println("East Button");

			}
		});

		btn3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e){
				System.out.println("Center Button");
			}
		});

		btn4.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent a){
				System.out.println("South Button");
			}
		});

		btn5.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent a){
				System.out.println("West Button");
			}
		});


		f.setVisible(true);		
	}

	public static void main(String[] args) {
		new ActionEventEx3();

	}

}
